// pages/transactionDetail/transactionDetail.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isHidden:true,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight,
          user_id: wx.getStorageSync('userid'),
        })
      }
    })
 
  },
  onShow:function(){
    var that=this
    clearTimeout();
    setTimeout(function(){
      getTrnsaction(that);
    },800)
  }
})

function getTrnsaction(that){
  wx.request({
    url: app.globalData.allUrl + "/api/all_record.php",
    data: {
      user_id: wx.getStorageSync('userid'),
     // user_id:'o6EMU0fMWNSX9CDcx2agBzWkKoxg'
    },
    header: { 'content-type': "application/x-www-form-urlencoded" },
    method: 'POST',
    success: function (res) {
       console.log(res.data)
       if (res.data.data.length==0){        
         that.setData({
           isHidden: false,
         })
       }
        that.setData({
          allLogs: res.data.data,
        })
    }, fail: function () {
    }
  })
}